package com.xiyin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiyin.entity.UserBatch;
import com.xiyin.mapper.UserBatchMapper;
import com.xiyin.service.IUserBatchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author xukaihang
 * @since 2024-08-18
 */
@Service
public class UserBatchServiceImpl extends ServiceImpl<UserBatchMapper, UserBatch> implements IUserBatchService {

    @Autowired
    private UserBatchMapper userBatchMapper;
    @Override
    public List<UserBatch> zidingyiBySQL() {
        //自定义sql查询
        int age = 18;
        return userBatchMapper.zidingyiBySQL(age);
    }

    @Override
    public List<UserBatch> zidingyiByZhujie() {
        //自定义sql查询
        int age = 18;
        return userBatchMapper.zidingyiByZhujie(age);
    }

    @Override
    public List<UserBatch> zidingyiByCondition() {
        return userBatchMapper.zidingyiByCondition(new LambdaQueryWrapper<UserBatch>()
                .eq(UserBatch::getAge,18));
    }
}
